package cn.edu.scau.cmi.liquan.exercise9.Example9_22;

import java.util.StringTokenizer;

public class ComputePrice {
    double compute(String s,String fenge) {
    	StringTokenizer fenxiOne=new StringTokenizer(s, fenge);
    	double sum=0;
    	double digitItem=0;
    	while(fenxiOne.hasMoreTokens()) {
    		String string=fenxiOne.nextToken();
    		digitItem=Double.parseDouble(string);
    		sum+=digitItem;
    	}
    	return sum;
    }
     
}
